﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ylh.Data;
using Ylh.ElvModel;
using Ylh.Enums;
using System.Data;

namespace Ylh.ElvBLL
{
    public class PcSystemInfoEvlBLL
    {
        /// <summary>
        /// 获取数据库中的当前程序的版本号
        /// </summary>
        /// <param name="ConStr"></param>
        /// <returns></returns>
        public string GetVersionCode(string ConStr)
        {
            TbPcSystemInfo info = new TbPcSystemInfo();
            SqlWhere where = new SqlWhere()
            {
                Info = info
            };
            DataTable dt = TbPcSystemInfo.Select(where, ConStr);
            return dt.Rows[0]["Version"].ToString();
        }


        /// <summary>
        /// 更新当前数据库的版本号码
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="NewVersionCode"></param>
        /// <returns></returns>
        public bool UpdataVersionCode(string ConStr, string NewVersionCode)
        {
            TbPcSystemInfo info = new TbPcSystemInfo();
            info.Version = NewVersionCode;
            return TbPcSystemInfo.Update(info, ConStr);
        }
    }
}
